function $(id){return document.getElementById(id)}
window.onload = function (){
    $("zhekou").onclick=function (){
        if($("zhekou").value=='wu')
        {
            $("zongnianlilv").value=$("nianlilv").value;

        }
        if($("zhekou").value=='qi')
        {
            $("zongnianlilv").value=$("nianlilv").value*0.7;

        }
        if($("zhekou").value=='jiu')
        {
            $("zongnianlilv").value=$("nianlilv").value*0.9;

        }

    }
    $("nianlilv").onclick=function (){
        if($("zhekou").value=='wu')
        {
            $("zongnianlilv").value=$("nianlilv").value;

        }
        if($("zhekou").value=='qi')
        {
            $("zongnianlilv").value=$("nianlilv").value*0.7;

        }
        if($("zhekou").value=='jiu')
        {
            $("zongnianlilv").value=$("nianlilv").value*0.9;

        }

    }
    $("ipt1").addEventListener("click",function (){
        $("div1").style.display='block';
        $("div2").style.display='none';
        $("but1").onclick=function (){
            $("bot").style.display='block';
            $("div4").style.display='none';
            var a= $("luochejiage").value;
            if($("daiqi").value=='6q')
            {
                $("meiyuehuankuan").value=a/6;
            }
            if($("daiqi").value=='9q')
            {
                $("meiyuehuankuan").value=a/9;
            }
            if($("daiqi").value=='12q')
            {
                $("meiyuehuankuan").value=a/12;
            }
            var b=$("zongnianlilv").value;
            $("lixizonge").value=$("luochejiage").value*(b/100.0);
            $("huankuanze").value=parseFloat($("luochejiage").value)+parseFloat($("lixizonge").value);
        }
    })

    $("ipt2").addEventListener("click",function (){
        $("div1").style.display='none';
        $("div2").style.display='block';
        $("6zx").onclick=function (){
            $("6zs").checked=false;
            this.checked=true;
        }
        $("6zs").onclick=function (){
            $("6zx").checked=false;
            this.checked=true;
        }
        $("but1").onclick=function (){
            $("bot").style.display='none';
            $("div4").style.display='block';
            if($("spd").value=='bj')
            {
                $("xinchegouzhi").value=1000;
                $("chechuanshiyong").value=2000;
                $("shangpai").value=1500;
                $("qiangxian").value=1200;
                $("feiheji").value=parseFloat($("xinchegouzhi").value)+
                    parseFloat($("chechuanshiyong").value)
                +parseFloat( $("shangpai").value)+
                    parseFloat($("qiangxian").value)+parseFloat($("luochejiage2").value);
            }
            if($("spd").value=='sh')
            {
                $("xinchegouzhi").value=1200;
                $("chechuanshiyong").value=2400;
                $("shangpai").value=1000;
                $("qiangxian").value=900;
                $("feiheji").value=parseFloat($("xinchegouzhi").value)+
                    parseFloat($("chechuanshiyong").value)
                    +parseFloat( $("shangpai").value)+
                    parseFloat($("qiangxian").value)+parseFloat($("luochejiage2").value);
            }
            if($("spd").value=='sc')
            {
                $("xinchegouzhi").value=900;
                $("chechuanshiyong").value=1800;
                $("shangpai").value=1250;
                $("qiangxian").value=1100;
                $("feiheji").value=parseFloat($("xinchegouzhi").value)+
                    parseFloat($("chechuanshiyong").value)
                    +parseFloat( $("shangpai").value)+
                    parseFloat($("qiangxian").value)+parseFloat($("luochejiage2").value);
            }
        }
    })
    $("but2").addEventListener("click",function (){

        $("bot").style.display='none';
        $("div4").style.display='none';


    })


}